<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class YpzxController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */

     public function Nquery(){
        

        $Nfilms = DB::table('films')
                ->leftjoin('film_atts','films.fid','=','film_atts.fid')
                ->select('films.fid as fi','films.title','films.intro','film_atts.period','films.org_img','films.actors','film_atts.is_new')
                ->get();
        $new = DB::table('filmnews')->get();

        return view('Home/filmn',['Nfilms'=>$Nfilms,'new'=>$new]);

    }

    public function xinwen(){
        $Nfilms = DB::table('films')
            ->leftjoin('film_atts','films.fid','=','film_atts.fid')
            ->select('films.fid','films.title','films.intro','film_atts.period','films.org_img','films.actors','film_atts.is_new')
            ->get();
        $news=DB::table('filmnews')->get();
        return view('Home/newart',['Nfilms'=>$Nfilms,'new'=>$news]);
    }

    public function art($id){
        $news=DB::table('filmnews')->find($id);
        return view('Home/art',['new'=>$news]);
    }

}
